//package com.javaserve.controller;
//
//
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.security.Principal;
//
//@RestController
//public class CurrentLoginUserController {
//    @GetMapping("/getLoginUser1")
//    public Authentication getLoginUser1(Authentication authentication){
//        return  authentication;
//    }
//
//    @GetMapping("/getLoginUser2")
//    public Principal getLoginUser1(Principal principal){
//        return  principal;
//    }
//
//    @GetMapping("/getLoginUser3")
//    public Principal getLoginUser1(){
//        return SecurityContextHolder.getContext().getAuthentication();
//    }
//}
